var appData = getApp().globalData;
Page({

  onLoad: function (op) {
    var giv = appData.user.openid + appData.user.openid,
    rect = parseInt(new Date().getTime() / 1000),
    code = giv.substring(rect % 28, rect % 28 + 3) + rect.toString(16).substring(1) + giv.substring(rect % 28 + 3, rect % 28 + 6) + parseInt(appData.share.share_id).toString(16) + '$' + appData.user.id;
    this.setData({
      code: code,
      info: {
        src: appData.user.nick,
        total: appData.share.total
      },
      hotelName: appData.hotelName[appData.hotel]
    })
    console.log(this.data.code, this.data.info)
  },
  onHide: function () {
    this.setData({ code: new Date().getTime().toString() })
  },
})